package com.ym.domain.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gitee.sunchenbin.mybatis.actable.annotation.ColumnComment;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import java.time.LocalDateTime;

@Data
@Table
@TableComment("客户表")
public class CusCustomer {

    @TableId
    @Column
    @ColumnComment("客户id")
    @IsKey
    private Integer customerId;

    /**
     * 是否实名认证。0-未实名，1-已实名
     */
    @Column
    @ColumnComment("是否实名认证。0-未实名，1-已实名")
    private Boolean isRealName;

    /**
     * 用户邮箱
     */
    @Column(length = 50)
    @ColumnComment("用户邮箱")
    private String email;

    /**
     * 邮箱是否认证。0-未认证，1-已认证
     */
    @Column
    @ColumnComment("邮箱是否认证。0-未认证，1-已认证")
    private Boolean isEmailVerified;

    /**
     * 手机号码
     */
    @Column(length = 11)
    @ColumnComment("手机号码")
    private String phoneNumber;

    /**
     * 手机是否认证。0-未认证，1-已认证
     */
    @Column
    @ColumnComment("手机是否认证。0-未认证，1-已认证")
    private Boolean isPhoneVerified;

    /**
     * 密码
     */
    @TableField(
            insertStrategy = FieldStrategy.NOT_EMPTY,
            updateStrategy = FieldStrategy.NOT_EMPTY,
            whereStrategy = FieldStrategy.NOT_EMPTY
    )
    @Column(length = 100)
    @ColumnComment("密码")
    private String password;

    /**
     * 安全码
     */
    @Column(length = 100)
    @ColumnComment("安全码")
    @JsonIgnore
    private String securityCode;

    /**
     * 微信号
     */
    @Column(length = 30)
    @ColumnComment("微信号")
    private String wechat;

    /**
     * QQ号
     */
    @Column(length = 20)
    @ColumnComment("QQ号")
    private String qq;

    /**
     * 帐号状态（0-正常，1-锁定交易，2-冻结）
     */
    @Column
    @ColumnComment("帐号状态（0-正常，1-锁定交易，2-冻结）")
    private Short status;

    @Column
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Column
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Column
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Boolean isDeleted;

}
